package com.atguigu.gulimall.cart.service;

import com.atguigu.gulimall.cart.vo.CartItemVo;
import com.atguigu.gulimall.cart.vo.CartVo;

import java.util.List;
import java.util.concurrent.ExecutionException;

/**
 * @version 1.0
 * @author: YangDongDong
 * @date: 2025/4/13 下午5:50
 * @description: todo
 */

public interface CartService
{
    CartVo getCart() throws ExecutionException, InterruptedException;

    CartItemVo addToCart(Long skuId, Integer num)throws ExecutionException, InterruptedException;

    /**
     * @author yangdongdong
     * @date   2025/4/15 下午9:44  
     * @description 根据skuId获取购物车中的商品信息
     * @param skuId sku的id
     * @return com.atguigu.gulimall.cart.vo.CartItemVo
     */
    CartItemVo getCartItem(Long skuId);

    /**
     * 清空购物车的数据
     * @param cartKey
     */
    public void clearCartInfo(String cartKey);

    /*
     * @author yangdongdong
     * @date   2025/4/15 下午9:47  
     * @description 
     * @param skuId
     * @param checked
     **/
    void checkItem(Long skuId, Integer checked);

    /**
     * @author yangdongdong
     * @date   2025/4/15 下午9:57
     * @description
     * @param skuId
     * @param num 数量
     */
    void changeItemCount(Long skuId, Integer num);

    void deleteIdCartInfo(Integer skuId);

    List<CartItemVo> getUserCartItems();

}
